﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Manage/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<QianBuo.Lottery.Web.Areas.Manage.Models.Lottery.ChuPiaoModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	出票
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <fieldset class="fieldset">
        <legend>出票</legend>
        <% Html.BeginForm(new { id="chupiaoform"},null); %>
        <table width="100%" class="table">
            <% if (!ViewData.ModelState.IsValid) %>
            <%{ %>
            <tr>
                <td>
                    <%=Html.ValidationMessage("Error") %>
                </td>
            </tr>
            <%} %>
            <tr>
                <td>
                    <label for="Lottery">
                        请选择彩种：</label>
                    <%=Html.DropDownListFor(p=>p.Lottery,Model.Lotterys.Each(p=>p.Selected=p.Value==Model.Lottery.ToString())) %>
                    <%=Html.ValidationMessageFor(p=>p.Lottery) %>
                </td>
                <td>
                    <label for="IssueID">
                        请选择期号</label><div id="div_issueid" style="display: inline">
                            <%=Html.DropDownListFor(p => p.IssueID, Model.Issues.Each(p => p.Selected = p.Value == Model.IssueID.ToString()))%></div>
                    <%=Html.ValidationMessageFor(p=>p.IssueID) %>
                </td>
                <td>
                    <input type="submit" value="出票" onclick="return confirm('确定提交吗？')" />
                </td>
            </tr>
        </table>
        <% Html.EndForm(); %>
    </fieldset>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="StyleAndScript" runat="server">
    <script type="text/javascript">
        var url = '<%=Url.Action("ChuPiaoIssue") %>';
        $(document).ready(function () {
            $("#chupiaoform #Lottery").change(function () {
                var val = this.value;
                if (val == "")
                    $("#div_issueid select").remove("option[value^='']");
                else {
                    $("#div_issueid").load(url, { id: val }, function () {
                        $("site_main").parent().unblock();
                    });
                    $("site_main").parent().block();
                }
            });
        });
    </script>
</asp:Content>
